﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace GDIPlusDemo
{
    public partial class Login : Form
    {
        //Model.userInfo m_userInfo = new Model.userInfo();
        BLL.userAccess b_userAccess = new BLL.userAccess();
        BLL.TCPComm b_TCPComm = new BLL.TCPComm();  

        public Login()
        {
            InitializeComponent();
        }

        private void butOpenComm_Click(object sender, EventArgs e)
        {            
            //m_userInfo.userAccount = textBoxAccount.Text.Trim();
            //m_userInfo.psw = textBoxPsw.Text.Trim();

            ////调试，固定账号和密码
            //m_userInfo.userAccount = "admin";
            //m_userInfo.psw = "admin";

            //if (b_userAccess.userLogin(m_userInfo) > 0)
            //{                
            //    //MessageBox.Show("登录成功");
            //   // b_TCPComm.openComm(textBoxSerIp.Text.Trim());
            //    //b_TCPComm.openComm("127.0.0.1");
            //    this.DialogResult = DialogResult.OK;
            //    this.Close();
            //}
            //else
            //{
            //    MessageBox.Show("登录失败");
            //}
        }

        private void butSendData_Click(object sender, EventArgs e)
        {
            b_TCPComm.sendData(textBoxSendData.Text);
        }

        private void butQuit_Click(object sender, EventArgs e)
        {
            b_TCPComm.closeSocket();
            Application.Exit();
        }        
    }
}
